package vn.isolar.object;

import java.io.Serializable;
import java.util.ArrayList;

import vn.isolar.util.parse_kml.Points;

import android.os.Bundle;

import com.google.android.maps.GeoPoint;

public class DetailRouting{
	ArrayList<Bundle> list_steps = new ArrayList<Bundle>();
	ArrayList<Bundle> list_global = new ArrayList<Bundle>();
	private int numNode;
	private int currentNode;
	public DetailRouting(ArrayList<Bundle> list_steps,ArrayList<Bundle> list_global){
		this.list_global = list_global;
		this.list_steps = list_steps;
		numNode = list_steps.size();
		currentNode = 0;
	}
	public ArrayList<Bundle> getListGlobal(){
		return list_global;
	}
	public ArrayList<Bundle> getListSteps(){
		return list_steps;
	}
	public String getGlobalDuration(){
		return list_global.get(0).getString("text");
	}
	public String getGlobalDistance(){
		return list_global.get(1).getString("text");
	}
	public String getStartAddr(){
		return list_global.get(2).getString("start_address");
	}
	public String getEndAddr(){
		return list_global.get(3).getString("end_address");
	}
	public Bundle moveToNext(){
		if (currentNode >= numNode){
			
			Bundle b = list_steps.get(numNode - 1);
			b.putBoolean("end", true);
			return b;
		}
		else
			return list_steps.get(currentNode++);
	}
}
